<?php $data = $model->getCommentsNest(['page' => $page, 'size' => $size]);?>
<?php if (!empty($data['comments'])):?>
<?php foreach ($data['comments'] as $index => $comment):?>
<div class="row comment-item">
	<div class="col-md-12">
		<div class="media" data-id=<?php echo $comment['id']?>>
          <img class="d-flex mr-3" src="/img/avatar.svg" alt="Generic placeholder image">
          <div class="media-body">
            <h6 class="mt-0 text-muted">
            	<small class="comment-meta"><?php echo ($offset + $index + 1)?>楼</small>
            	<small class="comment-meta"><?php echo $model->getNickname($comment)?></small>
            	<small class="comment-meta">来自[<?php echo $model->getRegion($comment)?>]</small>
            	<small class="comment-meta">发表于[<?php echo date('Y-m-d H:i:s', $comment['create_time'])?>]</small>
            </h6>
            <?php 
             if (!empty($comment['parents']))
             {
//                  echo $model->renderQuoteRecursion($comment['parents'], $data['commentsParents']);
                 echo $model->renderQuoteIteration($comment['parents'], $data['commentsParents']);
             }
             echo $comment['content'];
             ?>
             <p class="actions text-right">
    			<span class="like vote">支持(<?php echo $comment['like_count']?>)</span>
    			<span class="dislike vote">反对(<?php echo $comment['dislike_count']?>)</span>
    			<span class="reply">回复</span>
    		</p>
          </div>
        </div>
	</div>
</div>
<?php endforeach;?>
<?php endif;?>
